package com.example.lastwork2.adapter;

import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.viewpager2.adapter.FragmentStateAdapter;

import com.example.lastwork2.fragments.RecommendFragment;

import java.util.List;

public class HomeAdapter extends FragmentStateAdapter {
    private List<Fragment> fragments;

    public HomeAdapter(List<Fragment> fragments, RecommendFragment recommendFragment){
        super(recommendFragment);
        this.fragments = fragments;

    }


    @NonNull
    @Override
    public Fragment createFragment(int position) {
        return fragments.get(position);
    }

    @Override
    public int getItemCount() {
        return fragments.size();
    }
}
